opendir(DH,"/Users/yaping/Documents/workspace/result/GNOME-seq/");
foreach my $file(readdir(DH)){
	if($file=~/(methylCGsRich_gnome_seq_815C5ABXXMerge_)(\S+)_gch_table\.txt/){
		my $prefix=$1;
		my $name=$2;
		$file1=$file;
		$file2=$prefix.$name."_hcg_table.txt";
		$query="R --no-restore --no-save --args k=".$file1." s=".$file2." f=".$name." < /Users/yaping/Documents/workspace/R_script/pic_gnomeSeq_pj.R";
		system($query);
	}
	if($file=~/(methylCGsRich_gnome_seq_815C5ABXXMerge_)(\S+)(_cpg)_20bp_table\.txt/){
		my $prefix=$1;
		my $name=$2;
		$file2=$file;
		$file1=$prefix.$name."_20bp_table.txt";
		$query="R --no-restore --no-save --args k=".$file1." s=".$file2." f=".$name." < /Users/yaping/Documents/workspace/R_script/pic_gnomeSeq_pj.R";
		system($query);
		}
}

